#pragma once
#ifndef ENTITY_H
#define ENTITY_H

#include "DXUT.h"
#include "../Settings.h"
#include "../MathUtil.h"
#include "../Helper.h"

class EntityWorld;


class Entity 
{
protected:
	D3DXVECTOR3		m_Position;
	D3DXVECTOR3		m_Velocity;
	D3DXVECTOR3     m_Rotation;
	D3DXAABB		m_BoundingBox;

	bool			m_Grounded;
	bool			m_Physics;

#ifdef RENDER
	WORD			m_indexSize;

			ID3D11Buffer*	m_pVertexBuffer11;
			ID3D11Buffer*	m_pIndexBuffer11;
	static  ID3D11Buffer*	m_pcbVSPerObject11;
#endif

public:
	Entity(const D3DXVECTOR3& pos);
	Entity(const D3DXVECTOR3& pos, const D3DXAABB& aabb);

	virtual void OnFrameMove( EntityWorld * pWorld, double fTime, float fElapsedTime);

	D3DXVECTOR3 getPosition();

#ifdef RENDER
	virtual void OnD3D11FrameRender( const D3DXFRUSTUM frustum, EntityWorld * pWorld, ID3D11DeviceContext* pd3dImmediateContext, double fTime, float fElapsedTime);

	virtual void OnD3D11CreateDevice( ID3D11Device* pd3dDevice );
	void OnD3D11DestroyDevice( );

	static void InitDevice( ID3D11Buffer* cb );
#endif
};

#endif